/*
 * @Author: your name
 * @Date: 2020-12-12 00:24:26
 * @LastEditTime: 2020-12-17 11:12:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \12A-33组代码\src\api\inquiry.js
 */
import fetch from '../../utils/fetch'
// 患者端获取病例的接口
export const getInquiry = (data) => {
    return fetch.get('/v1/inquiry', {
        params: {
            patientid: localStorage.getItem('patient_id'),
            ...data
        }
    })
}

// 医生端获取当前所有患者会诊列表
export const getDInquiry = (data) => {
    return fetch.get('/v1/inquiry', {
        params: {
            ...data
        }
    })
}

// 医生端获取当前患者信息
export const putDInquiry = (id, data) => {
    console.log(id)
    return fetch.put(`/v1/inquiry/${id}`, {
        ...data
    })
}

// 与医生的聊天前，判断当前患者聊天状态
export const inquiryStatus = (data) => {
    return fetch.post('/v1/inquiry', { ...data })
}

// 患者端获取聊天室信息
export const inquiryMsg = (id) => {
    return fetch.get('/v1/inquiry', {
        params: {
            _id: id
        }
    })
}

// 结束问诊，修改当前问诊状态
export const finishInquiry = (id, data) => {
    return fetch.put(`/v1/inquiry/${id}`, { ...data })
}

// 提交医生评价
export const submitEva = (id, data) => {
    return fetch.put(`/v1/inquiry/${id}`, { rate: data })
}
